import React from 'react';
import { List } from 'antd-mobile';
import { connect } from 'dva';
import moment from 'moment';
import _ from 'lodash';
import MyBonus from './MyBonus';
import StatBonus from './StatBonus';

class Bonus extends React.Component {


  componentDidMount() {
  }

  render() {
    const { user } = this.props;
    const role = user.roles[user.roles.length - 1];
    if (role === 'salesman') {
      return <MyBonus />;
    } else {
      return <StatBonus />;
    }
  }
}


export default connect((state) => {
  return {
    user: state.auth.currentUser,
  };
},
  (dispatch) => {
    return {
      dispatch,
    };
  },
)(Bonus);
